<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<title><<{$pageTitle}>></title>
	<link rel="shortcut icon" href="__IMG__/favicon.ico"/>

	<link rel="stylesheet" href="__CIGO_ADMIN__/bootstrap-3.3.5-dist/css/bootstrap.min.css"/>
	<link rel="stylesheet" href="__CIGO_ADMIN__/layui-v2.3.0/layui/css/layui.css"/>
	<link rel="stylesheet" href="<<{:C('ICON_CONFIG')}>>.css"/>
	<link rel="stylesheet" href="__CIGO_ADMIN__/cigoos/cigoos.css"/>

	<script type="text/javascript" src="__CIGO_ADMIN__/jquery-2.1.4.min.js"></script>
	<script type="text/javascript" src="__CIGO_ADMIN__/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="__CIGO_ADMIN__/layui-v2.3.0/layui/layui.all.js"></script>
	<script type="text/javascript" src="<<{:C('ICON_CONFIG')}>>.js"></script>
	<script type="text/javascript" src="__CIGO_ADMIN__/cigoos/cigoos.js"></script>

	<style type="text/css">
		.container {
			border: 1px solid #ddd;
			border-radius: 6px;
			width: 600px;
			padding: 0px;
			margin-top: 80px;
		}

		.jumbotron {
			background-color: white;
			margin: 0px;
		}

		.title {
			color: #41578C;
			font-weight: 600;
			margin-bottom: 38px;
		}

		.form-group {
			width: 100%;
		}

		.input-group {
			width: 100%;
		}

		.input-group-addon {
			width: 100px;
			text-align: right;
		}
	</style>
</head>
<body>
<div class="container bs-docs-container">
	<div class="jumbotron">
		<h2 class="title">
			<img src="__IMG__/logo-land-with-title.jpg"/>
		</h2>
		<form id="form">
			<div class="form-group">
				<div class="input-group">
					<span class="input-group-addon">用户名:</span>
					<input name="username" type="text" class="form-control" placeholder="输入用户名..."/>
				</div>
			</div>
			<div class="form-group">
				<div class="input-group">
					<span class="input-group-addon">密码:</span>
					<input name="password" type="password" class="form-control" placeholder="输入登陆密码..."/>
				</div>
			</div>
			<div class="form-group">
				<div class="input-group">
					<span class="input-group-addon">验证码:</span>
					<input id="verifyCode" name="verify_code" type="text" class="form-control" placeholder="图片验证码..."/>
					<div class="input-group-btn">
						<div type="button" class="btn btn-default" style="padding: 0px;">
							<img alt="嘚瑟-" id="verifyCodeImg" src="<<{:U('Login/verifyCode')}>>"
							     style="width:100px;height: 32px;"/>
						</div>
						<button id="refreshBtn" type="button" class="btn btn-default">
							<span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>
						</button>
					</div>
				</div>
			</div>
			<div class="form-group btn-group">
				<a id="logBtn" class="btn btn-success btn-lg" href="<<{:U('Login/doLogIn')}>>"
				   formId='form'>
					登&nbsp;&nbsp;&nbsp;陆
				</a>
			</div>
		</form>
	</div>
</div>
<script type="text/javascript">
    var cigoLayer, cigoForm;
    ;!function () {
        cigoForm = layui.form;
        cigoLayer = layui.layer;
    }();
	$(function () {
		$('#refreshBtn').click(function () {
			$("#verifyCodeImg").attr("src", '<<{:U("Login/verifyCode")}>>?random=' + Math.random());
		});
		$('#verifyCodeImg').click(function () {
			$('#refreshBtn').click();
		});
		$("#form").keydown(function (event) {
			if ((event.which || event.keyCode) == 13) {
				$('#logBtn').trigger('click');
			}
		});
		$("#logBtn").click(function (evt) {
			formPost(evt, $(this), function (data) {
				if (data.url) {
					cigoLayer.msg(data.info + '<br/><br/>稍后页面将自动跳转~~', {icon: 6});
				} else {
					cigoLayer.msg(data.info, {icon: 6});
				}
				setTimeout(function () {
					if (data.url) {
						parent.location.href = data.url;
					} else {
						location.reload();
					}
				}, 1500);
			}, function (data) {
				cigoLayer.msg(data.info, {icon: 5});

				$('#verifyCode').val('');
				$('#refreshBtn').click();
			});

			return false;
		});
	});

</script>
</body>
</html>